home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / rexx / 130 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  5.2 KB

  1. Path: news.ox.ac.uk!news
  2. From: imc@ecs.ox.ac.uk (Ian Collier)
  3. Newsgroups: comp.lang.rexx,comp.lang.perl.misc
  4. Subject: Re: Perl to Rexx Conversion
  5. Date: 8 Jan 1996 16:57:54 GMT
  6. Organization: Oxford University Computing Laboratory
  7. Distribution: inet
  8. Message-ID: <7600.imc@comlab.ox.ac.uk>
  9. References: <4aq2ad$drl@ccnet2.ccnet.com> <4at9hp$r5m@picasso.op.net> <7580.imc@comlab.ox.ac.uk> <4b5cmg$474@csnews.cs.colorado.edu>
  10. NNTP-Posting-Host: boothp2.ecs.ox.ac.uk
  11. X-Local-Date: Monday, 8th January 1996 at 4:57pm GMT
  12.  
  13. Well it's been a while but I haven't seen a detailed answer to this so
  14. here goes.  (Actually I did reply to the email copy of this but it got
  15. returned a few days ago, so this is more or less the same as that).
  16.  
  17. In article <4b5cmg$474@csnews.cs.colorado.edu>, Tom Christiansen
  18. <tchrist@mox.Perl.com> writes:
  19. > [courtesy cc of this posting sent to cited author via email]
  20. [obviously I haven't bothered resending this by email :-) ]
  21.  
  22. > In comp.lang.Perl.misc, 
  23. >     imc@ecs.ox.ac.uk (Ian Collier) writes:
  24.  
  25. > Nonetheless, Rexx is not so clearly a structured programming language,
  26. > you know.  What about this:
  27. >      do i=1 to 10
  28. >         if i<8 then
  29. >            iterate i
  30. >         else
  31. >            signal somewhere  
  32. >      somewhere:
  33.  
  34. Ahem, you can write spaghetti code in almost any language!  That doesn't
  35. prove much.  For what it's worth, "signal" is supposed to be for an
  36. *abnormal* change in the flow of control and is deprecated as a "goto"
  37. instruction.  You cannot, for example, jump to a point that is inside a
  38. loop (even the same one that you are in at the moment) and expect it to
  39. continue looping.
  40.  
  41. > Since you bring up the matter, I was wondering about a few things:
  42.  
  43. As you probably know, Rexx has been fixed by an ANSI standard at
  44. approximately the level it was at in 1990 with a few small extensions.
  45. Object Rexx has been developed by IBM and is in beta testing (a public
  46. beta is on IBM's DevCon CD).  IBM plans to release a free source code
  47. version of Object Rexx for Linux.  I have seen demonstrations, but I
  48. have not used the product.
  49.  
  50. > Have they nailed down what lines() does yet, or is it still challenging
  51. > to check for eof()?  Can you explicitly open() and close() files and
  52. > pipes yet?
  53.  
  54. The standard specifies an action for lines(), although it will be some
  55. time before the majority of implementations become conforming.  There
  56. is no standard way to open and close files, though the stream() function
  57. provides a hook for the implementor to provide this, and the OS/2 syntax
  58. will probably become a defacto standard.  Checking for eof is still messy,
  59. though it can be done for example by calling stream() to get the file's
  60. status.
  61.  
  62. > Is it easy to load various and multiple functions from other files
  63. > yet?
  64.  
  65. If these files are Rexx files and if you want more than one of them in a
  66. file, then the answer is no, unless you are using Object Rexx, in which
  67. case I believe you can.
  68.  
  69. > Does Rexx have lexical scoping yet, or is all dynamic still?
  70.  
  71. I think one would say it is all dynamic, although in most programs it is
  72. hard to tell the difference.
  73.  
  74. > What about real arrays?  I don't just mean using word() or words() or
  75. > wordposs() and splitting on nothing but white space.  I mean real first
  76. > class lists.  It would also be nice to split on a pattern, like say
  77. > /\s*[;,]\s*/.  Can you sort your arrays?
  78.  
  79. Object Rexx has array objects but I don't know much about them.  I assume
  80. operations like split, join and sort are possible on these but I've no idea
  81. whether they are built in.
  82.  
  83. > Are there associative arrays yet?  Do you have things like keys(),
  84. > values(), each(), defined(), exists(), and delete()?  What about
  85. > defining a key retrieval ordering?
  86.  
  87. Associative arrays have always existed, as has defined() (though it is
  88. called symbol()).  It has always been possible to delete variables (or
  89. elements of an associative array) using the drop instruction.  Exists()
  90. I've never heard of.  Object Rexx has a "do over" construction which could
  91. be used to emulate the others.  It works for all kinds of objects, not just
  92. associative arrays.
  93.  
  94. > Can you pass things by reference or by value at your discretion?
  95. > Is this implicit or explicit?
  96.  
  97. Object Rexx has argument passing by reference.  The caller has no special
  98. syntax but the callee uses different syntaxes depending on whether it wants
  99. the parameters by value or by reference.  Of course the only way to pass a
  100. complex object like an associative array is by reference.
  101.  
  102. > Does it have regexps yet or is it just that clunky parse stuff?
  103.  
  104. No regexps, I'm afraid.  Some day, someone somewhere will write some.  Until
  105. then, parse isn't _that_ bad.
  106.  
  107. > Can you dynamically load C functions?  Can you test for whether
  108. > a function is defined or not?
  109.  
  110. There is no standard syntax for doing it while the Rexx program is
  111. running, but several implementations provide some.  The OS/2 syntax
  112. will again probably prevail.  It is also specified in the standard that
  113. the interpreter should have an API which allows the programmer to add some
  114. functions to the interpreter before starting it up.  The API has a routine
  115. which tests whether a function has been dynamically loaded; this call is
  116. also available to the OS/2 Rexx programmer.
  117.  
  118. Ian Collier - imc@comlab.ox.ac.uk - WWW Home Page (including REXX section):
  119. http://www.comlab.ox.ac.uk/oucl/users/ian.collier/index.html
  120.